QATextureNew
You can use theQATextureNew
function to create a new texture map.
TQAError QATextureNew ( const TQAEngine *engine, unsigned long flags, TQAImagePixelType pixelType, const TQAImage images[], TQATexture **newTexture);
engine
- A drawing engine.
flags
- A set of bit flags specifying features of the new texture map. See "Texture Flags Masks" (page 1-64) for complete information.
pixelType
- The type of pixels in the new texture map. See "Pixel Types" (page 1-35) for a description of the values you can pass in this parameter.
images
- An array of pixel images to use for the new texture map. The values in the
width
andheight
fields of these structures must be an even power of 2.newTexture
- On entry, the address of a pointer variable. On exit, that variable points to a new texture map. If a new texture map cannot be created,
*newTexture
is set to the valueNULL
.DESCRIPTION
TheQATextureNew
function returns, through thenewTexture
parameter, a new texture map associated with the drawing engine specified by theengine
parameter. You can use the returned texture map to set the value of thekQATag_Texture
state variable.The
flags
parameter specifies a set of texture map features. If thekQATexture_Lock
bit in that parameter is set but the drawing engine cannot guarantee that the texture will remain locked in memory, theQATextureNew
function returns an error.If the
kQATexture_Mipmap
bit of theflags
parameter is clear, theimages
parameter points to a single pixel image that defines the texture map. If thekQATexture_Mipmap
bit is set, theimages
parameter points to an array of pixel images of varying pixel depths. The first element in the array must be the mipmap page having the highest resolution, with a width and height that are even powers of 2. Each subsequent pixel image in the array should have a width and height that are half those of the previous image (with a minimum width and height of 1).SPECIAL CONSIDERATIONS
QATextureNew
does not automatically copy the pixmap data pointed to by theimages
parameter. As a result, you should not release or reuse the storage occupied by the pixel images until you've calledQATextureDetach
. Note, however, thatQATextureNew
does copy all of the information contained in theTQAImage
structures in the array, so you can free or reuse that memory afterQATextureNew
completes successfully.